import QtQuick 2.0
import QtQuick.Layouts 1.3


Rectangle {
    //id: sidebar

    width: 50
    color: "#C7BEBB"
    anchors.bottom: parent.bottom
    anchors.bottomMargin: 0
    anchors.top: parent.top
    anchors.topMargin: 0
    anchors.left: parent.left
    anchors.leftMargin: 0
    ListView{
        id:list
        anchors.fill: parent
        delegate: Rectangle {
            width: parent.width
            height: 60

            border.color: ListView.isCurrentItem ? "#EDF2F6" : "green"
            border.width: 1
            color: ListView.isCurrentItem ? "#EDF2F6" : "#C7BEBB"
            Item{
                anchors.fill: parent
                width: parent.width;
                Image {
                    anchors.top: parent.top
                    anchors.topMargin: 6
                    width: parent.width;fillMode: Image.PreserveAspectFit
                    source: imgScr
                }
                Text{ horizontalAlignment: Text.AlignHCenter;anchors.bottom: parent.bottom;anchors.bottomMargin: 6;width: parent.width;text:txtText}
            }
            MouseArea {
                anchors.fill: parent
                onClicked: list.currentIndex = index
            }
        }

        model: ListModel {
            ListElement {
                txtText: "inbox"
                imgScr: "qrc:/ico/ico/stack.png"
            }
            ListElement {
                txtText: "Action"
                imgScr: "qrc:/ico/ico/news.png"
            }
            ListElement {
                txtText: "Content"
                imgScr: "qrc:/ico/ico/stack.png"
            }
            ListElement {
                txtText: "Forecast"
                imgScr: "qrc:/ico/ico/calendar.png"
            }
            ListElement {
                txtText: "Flaged"
                imgScr: "qrc:/ico/ico/stack.png"
            }
            ListElement {
                txtText: "Review"
                imgScr: "qrc:/ico/ico/stack.png"
            }
            ListElement {
                txtText: "tixing"
                imgScr: "qrc:/ico/ico/stack.png"
            }
        }
    }
  }

